The PostScript Scanning ('scan') Resource
The PostScript scanning ('scan'
) resource, of typegxPostscriptScanningType
, is used with PostScript drivers to specify a set of replacement strings that are used when interpreting the status information returned by a PostScript printer. This resource is optional.Figure 6-27 shows the structure of a PostScript scanning resource.
Figure 6-27 The PostScript scanning resource
The PostScript scanning resource consists of an owner count field and an array of
string specifications.
Each string specification contains four strings. These strings together form the specification of how to replace strings in the status information that is returned
- Owner count.
by the printer.
You define the source string and replacement strings as
- Source string specification. Specifies the string to be searched for, as described
in Table 6-34.- Replacement string specification. Specifies the string with which to replace the
source string.- Offset specification. Specifies the offset at which to make the replacement, as described in Table 6-35.
- Action specification. Specifies the action to take after making the replacement, as described in Table 6-36.
StringScan
specifications, which have five variations, as shown in Table 6-34.You define the offset with an
OffsetScan
specification, which has six variations, as shown in Table 6-35. None of these requires the use of parameters.You define the action with an
ActionScan
specification, which has two variations, as shown in Table 6-36.Listing 6-25 shows the PostScript scanning resources from the Apple LaserWriter IIg printer driver.
Listing 6-25 An example of PostScript scanning resources for a printer driver
resource gxPostscriptScanningType (gxPostscriptScanningID, sysHeap, purgeable) { 0, { SimpleScan {"busy"}, SimpleScan { "printer busy" }, SimpleOffset {}, NoAction {}; SimpleScan {"waiting"}, SimpleScan {"preparing data"}, SimpleOffset {}, NoAction {}; SimpleScan {"job:"}, SimpleScan {"User"}, SimpleOffset {}, NoAction {}; } }; resource gxPostscriptScanningType (gxPostscriptScanningID + 1, sysHeap, purgeable) { 0, { SimpleScan {"%%["}, SimpleScan {""}, SimpleOffset {}, NoAction {}; SimpleScan {"]%%"}, SimpleScan {""}, SimpleOffset {}, NoAction {}; SimpleScan {"PrinterError"}, SimpleScan {"Printer"}, SimpleOffset {}, NoAction {}; }; };
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help